package ca.cbc.gisdigester.eveparser;

import java.util.Collection;

import ca.cbc.gisdigester.geoparser.GeoRSSPoint;

import com.sun.syndication.feed.module.ModuleImpl;

public class EveRSSModuleImpl extends ModuleImpl implements EveRSSModule {

	/**
	 * 
	 */
	private static final long serialVersionUID = 2112810742487485423L;
	private GeoRSSPoint point;
	private Collection polygon;
	private Collection line;
	private String audience;
	private String category;
	private String free;
	private String price;
	private long start;
	private long end;
	private String name;
	private String address;
	private String city;
	private String province;
	private String postalcode;
	private String coordinator;
	private String email;
	private String phone;
	private String company;
	private String link;
	private String repeats;
	public EveRSSModuleImpl() {
		super(EveRSSModule.class, EveRSSModule.EVERSS_URI);
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see com.sun.syndication.feed.CopyFrom#copyFrom(java.lang.Object)
	 */
	public void copyFrom(Object obj) {
		EveRSSModuleImpl eveRSSModule = (EveRSSModuleImpl) obj;
		this.setAddress(eveRSSModule.getAddress());
		this.setAudience(eveRSSModule.getAudience());
		this.setCategory(eveRSSModule.getCategory());
		this.setCity(eveRSSModule.getCity());
		this.setCompany(eveRSSModule.getCompany());
		this.setCoordinator(eveRSSModule.getCoordinator());
		this.setEmail(eveRSSModule.getEmail());
		this.setEnd(eveRSSModule.getEnd());
		this.setFree(eveRSSModule.getFree());
		this.setLatitude(eveRSSModule.getLatitude());
		this.setLine(eveRSSModule.getLine());
		this.setLink(eveRSSModule.getLink());
		this.setLongitude(eveRSSModule.getLongitude());
		this.setName(eveRSSModule.getName());
		this.setPhone(eveRSSModule.getPhone());
		this.setPoint(eveRSSModule.getPoint());
		this.setPolygon(eveRSSModule.getPolygon());
		this.setPostalcode(eveRSSModule.getPostalcode());
		this.setPrice(eveRSSModule.getPrice());
		this.setProvince(eveRSSModule.getProvince());
		this.setStart(eveRSSModule.getStart());
		this.setRepeats(eveRSSModule.getRepeats());
	}

	public String getAddress() {
		return address;
	}
	
	public String getAudience() {
		return audience;
	}

	public String getCategory() {
		return category;
	}

	public String getCity() {
		return city;
	}

	public String getCompany() {
		return company;
	}

	public String getCoordinator() {
		return coordinator;
	}

	public String getEmail() {
		return email;
	}

	public long getEnd() {
		return end;
	}

	public String getFree() {
		return free;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.sun.syndication.feed.CopyFrom#getInterface()
	 */
	public Class getInterface() {
		return EveRSSModule.class;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.georss.rome.GeoRSSModule#getLatitude()
	 */
	public double getLatitude() {
		if (point != null) {
			return point.getLatitude();
		}
		return 0;
	}

	/**
	 * @return the line
	 */
	public Collection getLine() {
		return line;
	}

	public String getLink() {
		return link;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.georss.rome.GeoRSSModule#getLongitude()
	 */
	public double getLongitude() {
		if (point != null) {
			return point.getLongitude();
		}
		return 0;

	}

	public String getName() {
		return name;
	}

	public String getPhone() {
		return phone;
	}

	/**
	 * @return the geoRSSPoint
	 */
	public GeoRSSPoint getPoint() {
		return point;
	}

	/**
	 * @return the polygon
	 */
	public Collection getPolygon() {
		return polygon;
	}

	public String getPostalcode() {
		return postalcode;
	}

	public String getPrice() {
		return price;
	}

	public String getProvince() {
		return province;
	}
	
	public String getRepeats() {
		return repeats;
	}
	
	public long getStart() {
		return start;
	}
	
	public void setAddress(String address) {
		this.address = address;
	}
	
	public void setAudience(String audience) {
		this.audience = audience;
	}
	
	public void setCategory(String category) {
		this.category = category;
	}
	
	public void setCity(String city) {
		this.city = city;
	}
	
	public void setCompany(String company) {
		this.company = company;
	}
	
	public void setCoordinator(String coordinator) {
		this.coordinator = coordinator;
	}
	
	public void setEmail(String email) {
		this.email = email;
	}

	public void setEnd(long end) {
		this.end = end;
	}

	public void setFree(String free) {
		this.free = free;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.georss.rome.GeoRSSModule#setLatitude(double)
	 */
	public void setLatitude(double latitude) {
		if (point == null) {
			point = new GeoRSSPoint();
		}
		point.setLatitude(latitude);
	}

	/**
	 * @param line
	 *            the line to set
	 */
	public void setLine(Collection line) {
		this.line = line;
	}

	public void setLink(String link) {
		this.link = link;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.georss.rome.GeoRSSModule#setLongitude(double)
	 */
	public void setLongitude(double longitude) {
		if (point == null) {
			point = new GeoRSSPoint();
		}
		point.setLongitude(longitude);
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	/**
	 * @param geoRSSPoint
	 *            the geoRSSPoint to set
	 */
	public void setPoint(GeoRSSPoint geoRSSPoint) {
		this.point = geoRSSPoint;
	}

	/**
	 * @param polygon
	 *            the polygon to set
	 */
	public void setPolygon(Collection polygon) {
		this.polygon = polygon;
	}

	public void setPostalcode(String postalcode) {
		this.postalcode = postalcode;
	}

	public void setPrice(String price) {
		this.price = price;
	}

	public void setProvince(String province) {
		this.province = province;
	}

	public void setRepeats(String repeats) {
		this.repeats = repeats;
	}

	public void setStart(long start) {
		this.start = start;
	}
}
